package com.github.chirspan.xaas.cfg.web.rest;


import com.github.chirspan.xaas.cfg.model.CfgApp;
import com.github.chirspan.xaas.api.BaseCRUDRestController;
import com.github.chirspan.xaas.core.rest.RestResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.github.chirspan.xaas.cfg.service.ICfgAppService;


/**
 * @Author: chenpan
 * @Date: 2021-04-07 18:24:53
 * @Description: 应用配置 REST API
 */
@RestController
@RequestMapping("cfgApp")
public class CfgAppController extends BaseCRUDRestController<CfgApp> {

    @Autowired
    private ICfgAppService appService;

    @GetMapping("/{code:.+}")
    public RestResult getByCode(@PathVariable("code") String code) {
        CfgApp app = appService.getAppByCode(code);
        return RestResult.OK(app);
    }
}